<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <Link rel="stylesheet" href="http://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
    <div id="selectResult">
        <table class="table table-dark table-hover">
            <thead>
                <tr>
                    <th>用户id</th>
                    <th>用户名称</th>
                    <th>用户密码</th>
                    <th>用户性别</th>
                    <th>用户年龄</th>
                    <th>用户角色</th>
                </tr>
            </thead>
            <tbody>
                <tr th:each="user:${userList}">
                    <td th:text="${user.id}"></td>
                    <td th:text="${user.username}"></td>
                    <td th:text="${user.password}"></td>
                    <td th:text="${user.sex}"></td>
                    <td th:text="${user.age}"></td>
                    <td th:text="${user.role}"></td>
                </tr>
            </tbody>
        </table>
        <div class="" style="width: 300px;margin: 0 auto;">
            <div>
                <strong>当前第[[${pageInfo.pageNum}]]页，共[[${pageInfo.pages}]]页.一共[[${pageInfo.total}]]条记录</strong>
            </div>
            <ul class="pagination pull-right no-margin" style="width: 500px">
                <li th:if="${pageInfo.hasPreviousPage}">
                    <a th:href="'user?pageNum = 1'">首页</a>
                </li>
                <li class="prev" th:if="${pageInfo.hasPreviousPage}">
                    <a th:href="'user?pageNum='+${pageInfo.prePage}">
                        <i class="ace-icon fa fa-angle-double-left"></i>
                    </a>
                </li>
                <!--            遍历-->
                <li th:each="nav:${pageInfo.navigatepageNums}">
                    <a th:href="'user?pageNum='+${nav}" th:text="'-'+${nav}+'-'" th:if="${nav!=pageInfo.pageNum}"></a>
                    <span style="font-weight: bold;background: #6faed9;" th:if="${nav==pageInfo.pageNum}" th:text="${nav}"></span>
                </li>
                <li class="next" th:if="${pageInfo.hasNextPage}">
                    <a th:href="'user?pageNum='+${pageInfo.nextPage}">-下一页
                        <i class="ace-icon fa fa-angle-double-right"></i>
                    </a>
                </li>
                <li>
                    <a th:href="'user?pageNum='+${pageInfo.pages}">
                        -尾页
                    </a>
                </li>
            </ul>
        </div>

        <form action="/logout" role="form" >
            <input type="submit" value="注销">
        </form>
    </div>
</body>
</html>